package com.heima.admin;



import com.heima.aliyun.GreenImageScan;
import com.heima.aliyun.GreenTextScan;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;


import java.util.Map;

@SpringBootTest
@RunWith(SpringRunner.class)
public class TextDemo {


    @Autowired
    GreenTextScan greenTextScan;

    @Autowired
    GreenImageScan greenImageScan;



    @Test
    public void test(){

        String content="法轮功是不好的";

        try {
            Map map = greenTextScan.greenTextScan(content);
            String  suggestion = (String) map.get("suggestion");
            //pass  block  review
            if("pass".equals(suggestion)){
                System.out.println("ok");
            }

            if("block".equals(suggestion)){
                System.out.println("fail");
            }
            if("review".equals(suggestion)){
                System.out.println("wait");
            }

        } catch (Exception e) {
            e.printStackTrace();

            System.out.println("wang luo bu chang ");
        }

    }

    @Test
    public void test02(){

    }


}
